/**
 * @fileOverview keydown shift multiSelected
 * @author huangtonger@aliyun.com
 */
const Page = require('../../base/');

Page.registerBehaviour('keydownShiftMultiSelected', diagram => {
  const graph = diagram.getGraph();
  graph.behaviourOn('keydown', ev => {
    const domEvent = ev.domEvent;
    if (domEvent.shiftKey) {
      diagram.setSignal('shiftKeyDown', true);
    }
  });
  graph.behaviourOn('keyup', ev => {
    const domEvent = ev.domEvent;
    if (!domEvent.shiftKey) {
      diagram.setSignal('shiftKeyDown', false);
    }
  });
});
